<!-- this.$emit用于子组件向父组件传递自定义事件 -->
<template>
  <div class="father">
    <h3>父组件，</h3>
		<Child ref="c"></Child>
  </div>
</template>

<script setup lang="ts" name="Father">
	import Child from './Child.vue'
import { ref,onMounted,defineExpose } from "vue";

const c = ref()
const name = ref('linli')

// 挂载的时候才有dom
onMounted(() => {
  console.log(c.value)
})
defineExpose({
  name:name.value
})

</script>